<?php
if($_SERVER['REQUEST_METHOD'] != 'POST'){
	header('location:/');
}
include '../webadmin/inc/global.php';
class Request {
    public $get = array();
    public $post = array();
    public $cookie = array();
    public $files = array();
    public $server = array();
    public function __construct() {
            $this->get = $this->clean($_GET);
            $this->post = $this->clean($_POST);
            $this->request = $this->clean($_REQUEST);
            $this->cookie = $this->clean($_COOKIE);
            $this->files = $this->clean($_FILES);
            $this->server = $this->clean($_SERVER);
    }

    public function clean($data) {
            if (is_array($data)) {
                    foreach ($data as $key => $value) {
                            unset($data[$key]);
                            $data[$this->clean($key)] = $this->clean($value);
                    }
            } else {
                    $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');
            }

            return $data;
    }
	public function escape($value) {
			$search = array("\\", "\0", "\n", "\r", "\x1a", "'", '"');
			$replace = array("\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"');
			return str_replace($search, $replace, $value);
	}
}
$request = new Request();
if(!isset($request->post['jobinfo'])){
	header('location:/');
}
$jobinfo = $request->post['jobinfo'];
$jobinfo7 = $request->escape($jobinfo['sen_jianli7']['y']).$request->escape($jobinfo['sen_jianli7']['m']).$request->escape($jobinfo['sen_jianli7']['d']);
$key = 'sen_jianli1,sen_jianli5,sen_jianli6,sen_jianli7,sen_jianli8,sen_jianli13,sen_jianli14,sen_jianli15,sen_jianli16,sen_jianli17,sen_jianli18,sen_jianli19,sen_jianli20,sen_jianli21,sen_jianli22';
$val = '"91","'.$request->escape($jobinfo['sen_jianli5']).'","'.$request->escape($jobinfo['sen_jianli6']).'","'.$jobinfo7.'","'.$request->escape($jobinfo['sen_jianli8']).'","'.$request->escape($jobinfo['sen_jianli13']).'","'.$request->escape($jobinfo['sen_jianli14']).'","'.$request->escape($jobinfo['sen_jianli15']).'","'.$request->escape($jobinfo['sen_jianli16']).'","'.$request->escape($jobinfo['sen_jianli17']).'","'.$request->escape($jobinfo['sen_jianli18']).'","'.$request->escape($jobinfo['sen_jianli19']).'","'.time().'","'.$request->escape($jobinfo['sen_jianli21']).'","'.$request->escape($jobinfo['sen_jianli22']).'"';
$insql = 'insert into sen_jianli('.$key.')values('.$val.')';
if($db->query($insql)){
	echo '<script>parent.jobsubmittatus(true)</script>';
}else{
	echo '<script>parent.jobsubmittatus(false)</script>';
}


